package com.java8feature.generic;

import java.lang.reflect.ParameterizedType;

/**
 * @Description:
 * @Author: yangzhiwei
 * @Date: 2021/5/15 13:04
 */

public abstract class AbstractDao<T> {
        public Class<T> getActualType() {


            ParameterizedType parameterizedType = (ParameterizedType) this.getClass().getGenericSuperclass();
            return (Class<T>) parameterizedType.getActualTypeArguments()[0];
        }
    }



